package com.imooc.news_manager_project.common.enums;

public enum ResultCode {
    /* 成功状态码 */
    ERROR(100, "失败"),
    SUCCESS(200, "成功"),
    SERVERERROR(500, "服务端错误"),
    /* 参数错误：1001~1999 */
    PARAM_IS_INVALID(1001, "参数无效"),
    PARAMS_CHECK_ERROR(1010, "参数校验失败"),
    PARAM_NOTHAVE_ID(1005, "不存在对应ID的数据"),
    /* 用户错误：2001~2999 */
    USER_NOT_LOGGED_IN(2001, "用户未登录，访问的路径需要验证，请登录"),
    USER_LOGIN_ERROR(2002, "账号或密码错误");
    private Integer code;
    private String message;

    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer code() {
        return this.code;
    }

    public String message() {
        return this.message;
    }

}
